package com.example.capsule.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.servers.Server;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Swagger/OpenAPI 配置
 */
@Configuration
public class SwaggerConfig {

    @Bean
    public OpenAPI customOpenAPI() {
        return new OpenAPI()
                .addServersItem(new Server().url("https://expensive-monroe-moms-revenues.trycloudflare.com").description("Production Server"))
                .info(new Info()
                        .title("时光胶囊API")
                        .version("1.0")
                        .description("写给未来的自己的时光胶囊应用API文档")
                        .contact(new Contact()
                                .name("开发者")
                                .email("developer@example.com")));
    }
}